package com.example.demo.controller;

import com.example.demo.mapper.PersonnelMapper;
import com.example.demo.pojo.Personnel;
import com.example.demo.service.PersonnelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api("人员操作类")
public class PersonnelController {

    @Autowired
    PersonnelService personnelService;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @ApiOperation("根据Id查询人员")
    @ApiImplicitParam(name = "id",value = "成员编号")
    @GetMapping("/query/{id}")
    public Personnel queryPersonnel(@PathVariable("id") int id){
        Personnel byId = personnelService.getById(id);
        System.out.println(byId.getPerName()+"------------------NAME1");
        return byId;
    }
}
